Add a stub for GPS_Serial_Close for Windows.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 9 Sep 2004 16:51:40 +0000 (16:51 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 9 Sep 2004 16:51:40 +0000 (16:51 +0000)
Remove O_NDELAY from open flags for Unix to make Linux USB/tty system happier.

gpsbabel/jeeps/gpsserial.c

index d0aa4631e6a4d5af117e5fd3fdff948addb4f431..b552ecf017d6c3eaa18880fb496c4a6479f64ac8 100644 (file)
@@ -180,6 +180,11 @@ int32 GPS_Serial_Read(int32 ignored, void *ibuf, int size)
        return cnt;
 }
 
+int32 GPS_Serial_Close(int32 fd, const char *port)
+{
+       return 1;
+}
+
 #else
 
 #include <sys/ioctl.h>
@@ -278,8 +283,13 @@ int32 GPS_Serial_Open(int32 *fd, const char *port)
 {
     struct termios tty;
     
-
-    if((*fd = open(port, O_RDWR | O_NDELAY | O_NOCTTY))==-1)
+    /*
+     * This originally had O_NDELAY | O_NOCTTY in here, but this
+     * causes problems with Linux USB ttys (observed on PL2303 and MCT)
+     * and the rest of the code doesn't _REALLY_ handle the partial 
+     * write/retry case anyway.  - robertl
+     */
+    if((*fd = open(port, O_RDWR))==-1)
     {
        perror("open");
        GPS_Error("SERIAL: Cannot open serial port");